require 'scanner/states/state'
require 'scanner/states/word_state'
require 'scanner/states/number_state'
require 'scanner/states/quote_state'
require 'scanner/states/operator_state'
require 'scanner/states/operator_equal_state'
require 'scanner/states/slash_state'

class StartState < State
  @token_type = :Nil

  def self.on_enter(token, char)
    @buffer = nil
  end
  def self.next_state(char)
    next_state = case char
      when '0'..'9': NumberState
      when 'a'..'z': WordState
      when 'A'..'Z': WordState
      when '"': QuoteState
      when '+', '-', '*', '(', ')', '[', ']', ',', '&', ';': OperatorState
      when ':', '!', '<', '>', '=': OperatorEqualState
      when '/': SlashState
      else StartState
    end
    return next_state
  end
end